home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 26 / AMIGAplus Sonderheft 26 (2000)(Falke)(DE)(Track 1 of 2)[!].iso / Tools / GFX-Viewer / Ham32k / HAM32K.MAN < prev    next >
Text File  |  1999-03-29  |  8KB  |  153 lines

  1.                              Ham32k - Version 0.01b
  2.                      32000 Colours on an ECS/OCS Amiga!
  3.                                 SDPrice 1998
  4.  
  5.  
  6.  
  7. READ THIS BIT FIRST:
  8. This an initial beta release, and as such is neither easy to use, nor very brilliant.
  9. If you have the time and patience it provides functionality, but nowt else.
  10.  
  11. At the time of release, I still do not know how to write out an IFF-ILBM, or how to open up an Amiga display.  At the moment the program can only read and write 24bit BMP files.
  12. So in order to use it you will have to convert the output file into an IFF file with some other image conversion software (Image Studio etc).  I'm currently reading all I can about such things, so if I get any kind of response I'll make a proper release that addresses these basic issues.
  13.  
  14. This beta release was released primarily to see if there was any interest in this kind of dithering technique.  If you like the way it makes your pictures look, (or if you use it at all), please contact me at one of the addresses at the end of this document with your comments.  If you are a coder yourself and have any information about IFF-ILBM's / opening custom screens or other Amiga related stuff, please please please send me a mail, so that I can make a decent version.
  15.  
  16. If you have coded any image manipulation software and would like to include a dither like the one used here, please feel free to do so.  I only ask that if you do, please send me a fully registered copy of your program, and an email/note explaining that you got the idea from my program.  (It would be nice if you mentioned my name in the documentation too).
  17.  
  18.  
  19.  
  20. USAGE:        Ham32k <inputfile> [outputfile]
  21.  
  22. Where inputfile is the full filename of your 24 bit colour BMP.
  23. The outputfile is optional, if omitted the output will be called <inputfile.32k>
  24.  
  25.  
  26. LIMITATIONS:
  27. This program is quick and dirty.  It reads only the bare minimum of the BMP header, (dimensions) and so can not cope with 256 colour BMP's (So no compression either).  At the moment there is no support for any other file type. (I had to reverse engineer the BMP format to get this far!).
  28.  
  29.  
  30. FUTURE:
  31. Where can I start?  Obviously save as IFF-ILBM and display without saving.
  32. JPEG and GIF support would be nice.
  33. If anybody thinks it's a good idea, I might include the ability to save the files in a bespoke 15bit RLE save format, which should result in much less disk space being used than either the 24bit BMP, or a double size 12bit IFF.
  34. Speed improvements on the disk read/writes.
  35. Unfortunately I have no plans on releasing a 68020+ version.  (What would be the point, if you have got an 020, you probably have AGA too).
  36.  
  37.  
  38. REQUIREMENTS:
  39. The actual conversion program requires very little ram at all.
  40. To display/store the resultant picture you generally will need twice as much disk space and chip memory as you needed for the normal picture.
  41.  
  42. This program was developed on an Amiga 500+ with 4meg fast 1meg chip 0.5meg slow.  OS version 2.04   .
  43. It should in theory work on any Amiga, as it makes no OS specific calls whatsoever, but I haven't tested it on any machine apart from my own, so I make no guarantees.
  44. If it doesn't work on your machine, that's just too bad.
  45.  
  46. ---------------------------------------------------------
  47.  
  48.  
  49.             Introduction to Ham32k
  50.             ~~~~~~~~~~~~~~~~~~~~~~
  51.  
  52.  
  53.  
  54. This program is cool because:
  55.  
  56. It allows a standard OCS/ECS Amiga to view 24bit BMP pictures in glorious pseudo 15 bit (32000 colours), instead of the usual 12 bit (4096 colours).
  57.  
  58.  
  59. It is all a big con because:
  60.  
  61. Actually all that it does it perform a very simple dither operation on the BMP, in order to fool the eye in believing that it is seeing 15bit colour instead of the actual 12 bits displayed.
  62.  
  63.  
  64. Why should you use it?
  65.  
  66. As far as I know, no other paint/image processing software can display images with this type of dither.
  67.  
  68.  
  69. What is so special about this dither?
  70.  
  71. This dither program does not corrupt the image, like most other dithers.  (I'm talking about that speckle affect).  In order to give the illusion of more colours, most dithering algorithms have to lose image quality in the form of resolution.  This is more noticeable in ordered dithers, than with non-ordered dithers, but the effect is still there.  This dither does not lose any image quality.
  72.  
  73.  
  74. How it does it:
  75.  
  76. Each 15bit-colour pixel value is divided equally into two 12 bit values.  These are saved as top, and bottom component pixels thus doubling the vertical resolution.  You then view this file in HAM interlaced mode to compensate for the changed aspect ratio. (1:2) 
  77.  
  78.  
  79. Confused? You will be.
  80.  
  81. (Maths explanation, even more confusing)
  82. A 24bit(16 Million value) colour picture is compromised of 3 8bit(256 value) channels, one each for the 3 primary colours.  An OCS/ECS Amiga is only capable of displaying 12Bit (4096 value) colour.  This is 4bits (16 values) per colour channel.  If you add 2 4bit values together you get a 5bit answer.
  83. e.g. 
  84. 16   +   16  =  32
  85. 4bit     4Bit   5Bit
  86.  
  87. Apply that to all three colour channels = 15bit  (5+5+5).
  88. Instead of 12bit  (4+4+4).
  89.  
  90.  
  91. How does that work out in real life?
  92.  
  93. You get an interlaced HAM screen made up of pairs of lines, with the top line of the pair holding one half of the 15bit pixel, and the bottom line holding the other half of the 15 bit pixel.  When displayed in HAM interlaced mode the image appears to be have 32000 colours.  This is much nicer on the eye than 12bit colour; flesh tones and shading appear especially nicer.  Despite what you may think, there is very little flicker, even though you are using an interlaced screen mode.  The reason for this is because the top and the bottom pixels of each pair are almost exactly the same brightness value.  Most of the flicker incurred with interlaced screens comes from high contrast borders between adjacent scan lines.
  94.  
  95.  
  96. Summary of Code (for programmers).
  97.  
  98. Action performed on each 8bit colour component.
  99. For the top half of each 2 pixel pair:   Output = Input masked to 4 bits.
  100. For the bottom half:  If bit 3 is set then output = input masked to 4 bits + 1,
  101.                       else = input masked to 4 bits.
  102. The brighter half of each 15bit pixel is actually alternated between the top and the bottom components every adjacent pixel.  This is to minimise interlace flicker.
  103.  
  104.  
  105. Downsides:
  106.  
  107. Because the image size is doubled, you will need twice as much chip ram to view any one picture, than before.  Because of this, and because you are using a higher resolution viewing mode, it takes longer to display the image.
  108. (Also in this beta release you will need twice as much hard disk space per picture).
  109.  
  110.  
  111. But, the improvement that 15 bit colour makes over 12 bit, can make this an acceptable sacrifice (depending on the image type, shading effects, your personal preference etc).
  112. ---
  113.  
  114.  
  115. To keep the archive size small I am not going to include any example pictures.  However I do plan to separately upload some example pictures if you want to see the difference.
  116.  
  117.  
  118. -----------------------------------------------------
  119.  
  120.  
  121. DISCLAIMER:
  122. Use at your own risk!
  123. I will not be held responsible for any damage that my code causes to your machine.
  124.  
  125.  
  126.  
  127. LEGAL:
  128. I reserve the copyright on the actual code used in this program, however you are free to distribute this software in any way that you like.  Refer to the top of the document for usage rights.
  129. I reserve the right to change, modify, or completely remove this software from public distribution at any time and for any reason.
  130.  
  131. BMP, IFF, JPG, GIF, AMIGA,  ... Are all copyrighted to their various owners.
  132. Imagestudio is a great piece of shareware (available on Aminet), get it today.
  133.  
  134. Apologies to anyone who I haven't mentioned who holds a copyright on a product that I have mentioned in this document.
  135.  
  136.  
  137.  
  138. CONTACT:
  139.  
  140.  
  141. Email:        chandlerbing@england.com
  142.   or          samprice@hotmail.com  
  143.               (only if you receive no reply from the above address).
  144.  
  145.  
  146. Snail Mail:   Samuel Price
  147.               20 Titania Close
  148.               Frankley
  149.               Birmingham
  150.               B45 0EE
  151.               England
  152.  
  153.